package com.ruoyi.web.controller.kaoyan.vo;

import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.kaoyan.domain.EducationForumComment;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Map;

/**
 * 评论VO类
 * @author admin
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CommentVo {
    private Long id;

    private String userName;

    private Long postId;

    private String categoryName;

    private Long parentId;

    private String content;

    private Long likeSum;

    private String verFlag;

    public CommentVo(EducationForumComment comment, Map<Long, String> map, Map<Long, String> userNameMap){
        this.id = comment.getId();
        this.userName = userNameMap.get(comment.getUserId());
        this.postId = comment.getPostId();
        this.categoryName = map.get(comment.getCategoryId());
        this.parentId = comment.getParentId();
        this.content = comment.getContent();
        this.likeSum = comment.getLikeSum();
        this.verFlag = StringUtils.isNull(comment.getVerFlag()) ? "null" : comment.getVerFlag().toString();
    }
}
